package com.campus.controller;

import com.campus.entity.ResultBody;
import com.campus.service.AccountMapOpenidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/info")
public class WeChatController {
    @Autowired
    private AccountMapOpenidService mapOpenidService;

    @RequestMapping("/add")
    public ResultBody addMap(String account, String openid){
        return mapOpenidService.add(account,openid);
    }

    @RequestMapping("/sendToPerson")
    public ResultBody sendToPerson( String account,Map<String,String> infos, String path){
        return mapOpenidService.sendToPerson(account,infos,path);
    }

    @RequestMapping("/sendFromCommittee")
    public ResultBody sendFromCommittee(String account,Map<String,String> infos,String path){
        return mapOpenidService.sendFromCommittee(account,infos,path);
    }
    @RequestMapping("/sendFromInstructor")
    public ResultBody sendFromInstructor(String account,Map<String,String> infos,String path){
        return mapOpenidService.sendFromInstructor(account,infos,path);
    }
    @RequestMapping("/sendFromDormAdmin")
    public ResultBody sendFromDormAdmin(String account,Map<String,String> infos,String path){
        return mapOpenidService.sendFromDormAdmin(account,infos,path);
    }
}
